<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<stripes:useActionBean var="u" binding="/users.action"/>
<c:import url="header.jsp">
    <c:param name="title" value="Seznam všech uživatelů"/>
</c:import>
<c:if test="${sessionScope.user != null}">
    <c:if test="${sessionScope.user.admin == 1}">
        <div id="users">
            <table>
                <tr>
                    <th>Login</th>
                    <th>Email</th>
                    <th>Heslo(hash)</th>
                    <th>Info</th>
                    <th>Pohlaví</th>
                    <th>Datum narození</th>
                </tr>
                <c:forEach items="${u.user.list}" var="usr" varStatus="loop">
                    <tr>
                        <td class="border"><a href="user.action?id=${usr.id}">${usr.login}</a></td>
                        <td class="border">${usr.email}</td>
                        <td class="border">${usr.password}</td>
                        <td class="border">${usr.info}</td>
                        <td class="border">${usr.gender}</td>
                        <td class="border">${usr.dateOfBirth}</td>
                        <c:if test="${sessionScope.user.id != usr.id}">
                            <td><a href="userDelete.action?id=${usr.id}">smaž</a></td>
                        </c:if>                 
                    </tr>
                </c:forEach>
            </table>
        </div>
    </c:if>
</c:if>
<c:import url="footer.jsp">
</c:import>